package com.lw.alarm.factory;

import javax.annotation.Resource;

import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import com.lw.alarm.filter.EmailFilter;
import com.lw.alarm.filter.FilterChain;
import com.lw.alarm.filter.SMSFilter;
import com.lw.alarm.filter.WeiXinFilter;
import com.lw.alarm.service.AlarmNoticeLogService;
import com.lw.alarm.util.compent.EmailHelper;

/**
 * 
 * @Description: 发送通知的工厂
 * @author wei.liu
 * @date 2017年4月19日 下午2:40:52
 * @version V1.0
 */
@Component
public class FilterFactory implements FilterFactoryApi {
	@Resource
	private EmailHelper emailHelper;
	@Resource
	private AlarmNoticeLogService alarmNoticeLogService;

	public FilterChain createFilterChain() {
		FilterChain f = new FilterChain();
		f.addFilter(new EmailFilter(emailHelper, alarmNoticeLogService));
		f.addFilter(new SMSFilter(alarmNoticeLogService));
		f.addFilter(new WeiXinFilter());
		return f;
	}
}
